"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserModel = void 0;
class UserModel {
    constructor() {
        this.coins = 0;
        this.diamond = 0;
        this.room_id = 0;
    }
    json2Model(data) {
        this.userid = data.userid;
        this.account = data.account;
        this.nick_name = data.nick_name;
        this.sex = data.sex;
        this.headimg = data.headimgurl;
    }
    resource2Model(data) {
        this.coins = data["coins"];
        this.diamond = data["diamond"];
    }
    static db2Model(data) {
        let model = new UserModel();
        model.json2Model(data);
        return model;
    }
    destroy() {
    }
    model2proto() {
        let userinfo = {
            userId: this.userid,
            userName: this.nick_name,
            userPhoto: this.headimg,
            sex: this.sex,
            coins: this.coins,
            diamond: this.diamond
        };
        return userinfo;
    }
}
exports.UserModel = UserModel;
